import { Component, EventEmitter, Input, Output } from '@angular/core';
import { PlcConfig } from 'src/components/scenarios/models';

@Component({
  selector: 'app-plc-setting',
  templateUrl: './plc-setting.component.html',
  styleUrl: './plc-setting.component.scss'
})
export class PlcSettingComponent {
  private _plc: PlcConfig = {
    Ip: "",
    Port: 102,
    Interval: 1000,
  };
  @Input()
  public get plc(): PlcConfig {
    return this._plc;
  }
  public set plc(value: PlcConfig) {
    this._plc = value;

    this.plcChange.emit(value);
  }

  @Output()
  plcChange: EventEmitter<PlcConfig> = new EventEmitter();
}
